package com.ad.pet.ui;

import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import com.ad.pet.R;
import com.ad.pet.utils.LyxUtils;

/**
 * Created by SEELE on 2019/6/11.
 */

public class RegistSuccessDialog extends Dialog{
    public RegistSuccessDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
        initView(context);
    }


    private void initView(Context context) {
        View view = View.inflate(context, R.layout.layout_regist_success_dialog,null);

        view.findViewById(R.id.tv_all_back).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
        view.findViewById(R.id.iv_close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
//        ImageView imageView = view.findViewById(R.id.iv_bg);
//        if ("cn".equals(SpUtil.getInstance().getString(Constant.LANGUAGE, "cn"))){
//            imageView.setImageResource(R.drawable.ic_reg_succ_en);
//        }else {
//            imageView.setImageResource(R.drawable.ic_regist_succ);
//        }

        setContentView(view);



        Window window = this.getWindow();
        WindowManager.LayoutParams lp = window.getAttributes();
        lp.width = LyxUtils.dp2px(context,250);
        lp.height = LyxUtils.dp2px(context,300);
        this.getWindow().setAttributes(lp);
        window.setGravity(Gravity.CENTER);
    }
}
